<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Members extends CI_Controller {
	function index()
	{
		$data['error'] ='display: none;';
		if($this->session->userdata('email') || $this->session->userdata('logged'))
		{
			
			$this->load->library('pagination');
			$config['total_rows'] = $this->db->count_all('landing_user');
			$this->pagination->initialize($config);
				
			$this->load->model('admin_model');
			$data['results'] = $this->admin_model->list_user();	
			$data['content'] ='admin/members';
			$data['members'] = 'active';
			//$data['count'] = $count;
			$this->load->view('admin/template/template',$data);	
		}
		else 
		{
			$this->load->view('admin/signup',$data);
		}
	}
	
	function delete()
	{
		if($this->uri->segment(3))
		{
			$this->load->model('crud_model');
			$this->crud_model->delete($this->uri->segment(3));
			
			$this->load->model('admin_model');
			$data['results'] = $this->admin_model->list_user();	
			$data['content'] ='admin/members';
			$data['members'] = 'active';
			//$data['count'] = $count;
			$data['success'] = 'display: block;';
			$this->load->view('admin/template/template',$data);	
		}
		else 
		{
			$this->load->model('admin_model');
			$data['results'] = $this->admin_model->list_user();	
			$data['content'] ='admin/members';
			$data['members'] = 'active';
			//$data['count'] = $count;
			$data['error'] = 'display: block;';
			$this->load->view('admin/template/template',$data);	
			
		}
	}
	
}		
?>